﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using DAL;

namespace logic
{
    public class sysLog
    {
        public static void insert(SysLogEntity log)
        {
            SysLog.insert(log);
        }
        public static void setProcess(int slid, int adminID)
        {
            SysLog.setProcess(slid, adminID);
        }
        public static void setView(int slid)
        {
            SysLog.setView(slid);
        }
        public static DataRow selectByID(int slid)
        {
            return SysLog.selectByID(slid);
        }
        public static DataSet getList(string where, string orderby, int pagesize, int pageindex)
        {
            return DbHelper.ExecuteDataSetPageSize("a.*", "SysLog a", where, "a.slId", orderby, pagesize, pageindex);
        }

        public static void insertSendemailFailed(string slinfor)
        {
            DAL.SysLogEntity log = new DAL.SysLogEntity();
            log.SlInfor = slinfor;
            log.SlServerity = "A";
            log.SlEmergency = "A";
            log.SlUrl = System.Web.HttpContext.Current.Request.Url.ToString();
            log.Slip = System.Web.HttpContext.Current.Request.UserHostAddress.ToString();
            logic.sysLog.insert(log);
        }

        public static void insertFacade(string strMessage)
        {
            DAL.SysLogEntity log = new DAL.SysLogEntity();
            log.SlInfor = strMessage;
            log.SlServerity = "A";
            log.SlEmergency = "A";
            log.SlUrl = System.Web.HttpContext.Current.Request.Url.ToString();
            log.Slip = System.Web.HttpContext.Current.Request.UserHostAddress.ToString();
            logic.sysLog.insert(log);
        }
    }
}
